home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / gllight.z / gllight
Encoding:
Text File  |  2002-10-03  |  17.5 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllLLLLiiiigggghhhhttttffff,,,, ggggllllLLLLiiiigggghhhhttttiiii,,,, ggggllllLLLLiiiigggghhhhttttffffvvvv,,,, ggggllllLLLLiiiigggghhhhttttiiiivvvv - set light source parameters
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void ggggllllLLLLiiiigggghhhhttttffff( GLenum _l_i_g_h_t,
  14.                     GLenum _p_n_a_m_e,
  15.                     GLfloat _p_a_r_a_m )
  16.      void ggggllllLLLLiiiigggghhhhttttiiii( GLenum _l_i_g_h_t,
  17.                     GLenum _p_n_a_m_e,
  18.                     GLint _p_a_r_a_m )
  19.  
  20.  
  21. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  22.      _l_i_g_h_t   Specifies a light.  The number of lights depends on the
  23.              implementation, but at least eight lights are supported.  They
  24.              are identified by symbolic names of the form GGGGLLLL____LLLLIIIIGGGGHHHHTTTTi where 0 _<
  25.              i < GGGGLLLL____MMMMAAAAXXXX____LLLLIIIIGGGGHHHHTTTTSSSS.
  26.  
  27.      _p_n_a_m_e   Specifies a single-valued light source parameter for _l_i_g_h_t.
  28.              GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT, GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF, GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN,
  29.              GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN, and GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN are accepted.
  30.  
  31.      _p_a_r_a_m   Specifies the value that parameter _p_n_a_m_e of light source _l_i_g_h_t
  32.              will be set to.
  33.  
  34. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  35.      void ggggllllLLLLiiiigggghhhhttttffffvvvv( GLenum _l_i_g_h_t,
  36.                      GLenum _p_n_a_m_e,
  37.                      const GLfloat *_p_a_r_a_m_s )
  38.      void ggggllllLLLLiiiigggghhhhttttiiiivvvv( GLenum _l_i_g_h_t,
  39.                      GLenum _p_n_a_m_e,
  40.                      const GLint *_p_a_r_a_m_s )
  41.  
  42.  
  43. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  44.      _l_i_g_h_t
  45.           Specifies a light.  The number of lights depends on the
  46.           implementation, but at least eight lights are supported.  They are
  47.           identified by symbolic names of the form GGGGLLLL____LLLLIIIIGGGGHHHHTTTTi where 0 _< i <
  48.           GGGGLLLL____MMMMAAAAXXXX____LLLLIIIIGGGGHHHHTTTTSSSS.
  49.  
  50.      _p_n_a_m_e
  51.           Specifies a light source parameter for _l_i_g_h_t.  GGGGLLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT,
  52.           GGGGLLLL____DDDDIIIIFFFFFFFFUUUUSSSSEEEE, GGGGLLLL____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR, GGGGLLLL____PPPPOOOOSSSSIIIITTTTIIIIOOOONNNN, GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF,
  53.           GGGGLLLL____SSSSPPPPOOOOTTTT____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN, GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT, GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN,
  54.           GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN, and GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN are accepted.
  55.  
  56.      _p_a_r_a_m_s
  57.           Specifies a pointer to the value or values that parameter _p_n_a_m_e of
  58.           light source _l_i_g_h_t will be set to.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))
  71.  
  72.  
  73.  
  74. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  75.      ggggllllLLLLiiiigggghhhhtttt sets the values of individual light source parameters.  _l_i_g_h_t
  76.      names the light and is a symbolic name of the form GGGGLLLL____LLLLIIIIGGGGHHHHTTTTi, where 0 _< i
  77.      < GGGGLLLL____MMMMAAAAXXXX____LLLLIIIIGGGGHHHHTTTTSSSS.  _p_n_a_m_e specifies one of ten light source parameters,
  78.      again by symbolic name.  _p_a_r_a_m_s is either a single value or a pointer to
  79.      an array that contains the new values.
  80.  
  81.      To enable and disable lighting calculation, call ggggllllEEEEnnnnaaaabbbblllleeee and ggggllllDDDDiiiissssaaaabbbblllleeee
  82.      with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTTIIIINNNNGGGG. Lighting is initially disabled.  When it is
  83.      enabled, light sources that are enabled contribute to the lighting
  84.      calculation.  Light source i is enabled and disabled using ggggllllEEEEnnnnaaaabbbblllleeee and
  85.      ggggllllDDDDiiiissssaaaabbbblllleeee with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTTi.
  86.  
  87.      The ten light parameters are as follows:
  88.  
  89.      GGGGLLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT          _p_a_r_a_m_s contains four integer or floating-point values
  90.                          that specify the ambient RGBA intensity of the light.
  91.                          Integer values are mapped linearly such that the most
  92.                          positive representable value maps to 1.0, and the
  93.                          most negative representable value maps to -1.0.
  94.                          Floating-point values are mapped directly.  Neither
  95.                          integer nor floating-point values are clamped.  The
  96.                          initial ambient light intensity is (0, 0, 0, 1).
  97.  
  98.      GGGGLLLL____DDDDIIIIFFFFFFFFUUUUSSSSEEEE          _p_a_r_a_m_s contains four integer or floating-point values
  99.                          that specify the diffuse RGBA intensity of the light.
  100.                          Integer values are mapped linearly such that the most
  101.                          positive representable value maps to 1.0, and the
  102.                          most negative representable value maps to -1.0.
  103.                          Floating-point values are mapped directly.  Neither
  104.                          integer nor floating-point values are clamped.  The
  105.                          initial value for GGGGLLLL____LLLLIIIIGGGGHHHHTTTT0000 is (1, 1, 1, 1); for
  106.                          other lights, the initial value is (0, 0, 0, 0).
  107.  
  108.      GGGGLLLL____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR         _p_a_r_a_m_s contains four integer or floating-point values
  109.                          that specify the specular RGBA intensity of the
  110.                          light.  Integer values are mapped linearly such that
  111.                          the most positive representable value maps to 1.0,
  112.                          and the most negative representable value maps to
  113.                          -1.0.  Floating-point values are mapped directly.
  114.                          Neither integer nor floating-point values are
  115.                          clamped.  The initial value for GGGGLLLL____LLLLIIIIGGGGHHHHTTTT0000 is (1, 1,
  116.                          1, 1); for other lights, the initial value is (0, 0,
  117.                          0, 0).
  118.  
  119.      GGGGLLLL____PPPPOOOOSSSSIIIITTTTIIIIOOOONNNN         _p_a_r_a_m_s contains four integer or floating-point values
  120.                          that specify the position of the light in homogeneous
  121.                          object coordinates.  Both integer and floating-point
  122.                          values are mapped directly.  Neither integer nor
  123.                          floating-point values are clamped.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))
  137.  
  138.  
  139.  
  140.                          The position is transformed by the modelview matrix
  141.                          when ggggllllLLLLiiiigggghhhhtttt is called (just as if it were a point),
  142.                          and it is stored in eye coordinates.  If the w
  143.                          component of the position is 0, the light is treated
  144.                          as a directional source.  Diffuse and specular
  145.                          lighting calculations take the light's direction, but
  146.                          not its actual position, into account, and
  147.                          attenuation is disabled.  Otherwise, diffuse and
  148.                          specular lighting calculations are based on the
  149.                          actual location of the light in eye coordinates, and
  150.                          attenuation is enabled.  The initial position is (0,
  151.                          0, 1, 0); thus, the initial light source is
  152.                          directional, parallel to, and in the direction of the
  153.                          -z axis.
  154.  
  155.      GGGGLLLL____SSSSPPPPOOOOTTTT____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN   _p_a_r_a_m_s contains three integer or floating-point
  156.                          values that specify the direction of the light in
  157.                          homogeneous object coordinates.  Both integer and
  158.                          floating-point values are mapped directly.  Neither
  159.                          integer nor floating-point values are clamped.
  160.  
  161.                          The spot direction is transformed by the inverse of
  162.                          the modelview matrix when ggggllllLLLLiiiigggghhhhtttt is called (just as
  163.                          if it were a normal), and it is stored in eye
  164.                          coordinates.  It is significant only when
  165.                          GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF is not 180, which it is initially.
  166.                          The initial direction is (0, 0, -1).
  167.  
  168.      GGGGLLLL____SSSSPPPPOOOOTTTT____EEEEXXXXPPPPOOOONNNNEEEENNNNTTTT    _p_a_r_a_m_s is a single integer or floating-point value
  169.                          that specifies the intensity distribution of the
  170.                          light.  Integer and floating-point values are mapped
  171.                          directly.  Only values in the range [0,128] are
  172.                          accepted.
  173.  
  174.                          Effective light intensity is attenuated by the cosine
  175.                          of the angle between the direction of the light and
  176.                          the direction from the light to the vertex being
  177.                          lighted, raised to the power of the spot exponent.
  178.                          Thus, higher spot exponents result in a more focused
  179.                          light source, regardless of the spot cutoff angle
  180.                          (see GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF, next paragraph).  The initial
  181.                          spot exponent is 0, resulting in uniform light
  182.                          distribution.
  183.  
  184.      GGGGLLLL____SSSSPPPPOOOOTTTT____CCCCUUUUTTTTOOOOFFFFFFFF      _p_a_r_a_m_s is a single integer or floating-point value
  185.                          that specifies the maximum spread angle of a light
  186.                          source.  Integer and floating-point values are mapped
  187.                          directly.  Only values in the range [0,90] and the
  188.                          special value 180 are accepted.  If the angle between
  189.                          the direction of the light and the direction from the
  190.                          light to the vertex being lighted is greater than the
  191.                          spot cutoff angle, the light is completely masked.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ggggllllLLLLiiiigggghhhhtttt((((3333GGGG))))
  203.  
  204.  
  205.  
  206.                          Otherwise, its intensity is controlled by the spot
  207.                          exponent and the attenuation factors.  The initial
  208.                          spot cutoff is 180, resulting in uniform light
  209.                          distribution.
  210.  
  211.      GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  212.  
  213.      GGGGLLLL____LLLLIIIINNNNEEEEAAAARRRR____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  214.  
  215.      GGGGLLLL____QQQQUUUUAAAADDDDRRRRAAAATTTTIIIICCCC____AAAATTTTTTTTEEEENNNNUUUUAAAATTTTIIIIOOOONNNN
  216.                          _p_a_r_a_m_s is a single integer or floating-point value
  217.                          that specifies one of the three light attenuation
  218.                          factors.  Integer and floating-point values are
  219.                          mapped directly.  Only nonnegative values are
  220.                          accepted.  If the light is positional, rather than
  221.                          directional, its intensity is attenuated by the
  222.                          reciprocal of the sum of the constant factor, the
  223.                          linear factor times the distance between the light
  224.                          and the vertex being lighted, and the quadratic
  225.                          factor times the square of the same distance.  The
  226.                          initial attenuation factors are (1, 0, 0), resulting
  227.                          in no attenuation.
  228.  
  229. NNNNOOOOTTTTEEEESSSS
  230.      It is always the case that GGGGLLLL____LLLLIIIIGGGGHHHHTTTTi = GGGGLLLL____LLLLIIIIGGGGHHHHTTTT0000 + i.
  231.  
  232. EEEERRRRRRRROOOORRRRSSSS
  233.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if either _l_i_g_h_t or _p_n_a_m_e is not an accepted
  234.      value.
  235.  
  236.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if a spot exponent value is specified
  237.      outside the range [0,128], or if spot cutoff is specified outside the
  238.      range [0,90] (except for the special value 180), or if a negative
  239.      attenuation factor is specified.
  240.  
  241.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllLLLLiiiigggghhhhtttt is executed between the
  242.      execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  243.  
  244. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  245.      ggggllllGGGGeeeettttLLLLiiiigggghhhhtttt
  246.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTTIIIINNNNGGGG
  247.  
  248.  
  249. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  250.      ggggllllCCCCoooolllloooorrrrMMMMaaaatttteeeerrrriiiiaaaallll, ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll, ggggllllMMMMaaaatttteeeerrrriiiiaaaallll
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.